﻿@using BestTrader.Cms.ViewModels
@{
    ViewData["Title"] = "出入金记录";

    var AgentManagers = ViewData["AgentManagers"] as List<ItemsDetailModel>;

}
<blockquote class="layui-elem-quote quoteBox">
    <form class="layui-form">
        @Html.AntiForgeryToken()
        <div class="layui-inline">
            <div class="layui-input-inline">
                <input type="text" class="layui-input searchVal" placeholder="请输入直客姓名或真实姓名" />
            </div>
        </div>
        <div class="layui-inline">
            <div class="layui-input-inline">
                <input type="text" name="startdate" id="startdate" lay-verify="startdate" placeholder="开始时间" autocomplete="off" class="layui-input startdate" readonly>
            </div>
        </div>
        <div class="layui-inline">
            <div class="layui-input-inline">
                <input type="text" name="enddate" id="enddate" lay-verify="enddate" placeholder="结束时间" autocomplete="off" class="layui-input enddate" readonly>
            </div>
        </div>
        <div class="layui-input-inline">
            <div class="layui-input-inline">
                <select name="searchState" class="searchState" lay-verify="required">
                    <option value="">全部</option>
                    <option value="1">入金</option>
                    <option value="2">出金</option>
                </select>
            </div>
        </div>
        <div class="layui-input-inline">
            <div class="layui-input-inline">
                <select name="searchUserList" class="searchUserList" lay-filter="searchUserList" lay-verify="required">
                    <option value="">所有客户</option>
                    @foreach (var item in AgentManagers)
                    {
                        <option value="@item.ItemCode">@(item.ItemData):@(item.ItemName)</option>
                    }
                </select>
            </div>
        </div>
        <div class="layui-inline">
            <a class="layui-btn search_btn" data-type="reload">搜索</a>
        </div>
        @*<div class="layui-inline">
                <a class="layui-btn layui-btn-warm code_btn" style="display:none;">导出</a>
            </div>*@
    </form>
    <table class="layui-table" style="width:400px">
        <colgroup>
            <col width="200">
            @*<col width="200">*@
            <col width="200">

        </colgroup>
        <thead>
            <tr>
                <th>入金合计(美元)</th>
                @*<th>入金(RMB)合计</th>*@
                <th>出金合计(美元)</th>
            </tr>
        </thead>
        <tbody>
            <tr>
                <td id="txtTotalInAmount"> </td>
                @*<td id="txtTotalInRMBAmount"> </td>*@
                <td id="txtTotalOutAmount"> </td>

            </tr>
        </tbody>
    </table>
  
</blockquote>
<table id="managerList" lay-filter="managerList"></table>
<script type="text/html" id="State">
    {{#  if(d.Cash_State === 1){ }}
    <a class="layui-btn layui-btn-xs">入金</a>
    {{#  } else{ }}
    <a class="layui-btn layui-btn-xs layui-btn-danger" lay-event="state">出金</a>
    {{#  }}}
</script>
<script type="text/html" id="Amount">
    
    <span {{ d.Cash_State==2 ?'style="color:red"':''}}>{{ d.CurrencyCodeName }}{{ d.Amount }}</span>
</script>
<script type="text/html" id="UserName">
    <span>{{ d.UserName }}({{ d.RealName }})</span>
</script>
<!--操作-->
@section Scripts{
    <script type="text/javascript" src="~/layui-v2.4.5/layui.js"></script>
    <script type="text/javascript" src="~/js/history/historyCashList.js?_=@DateTime.Now.ToString("yyyyMMddHHmmss")"></script>
}